import request from "@/utils/request";

// 获取分类列表
const getCategoryList = (query) => {
  return request({
    url: `/website/media/category/list`,
    method: "get",
    params: query,
  });
};

const addCategory = (query) => {
  return request({
    url: `/website/media/category`,
    method: "post",
    data: query,
  });
};

// 删除分类
const deleteCategory = (id) => {
  return request({
    url: `/website/media/category/${id}`,
    method: "delete",
  });
};

// 新增标签
const addTag = (query) => {
  return request({
    url: `/website/tag`,
    method: "post",
    data: query,
  });
};
// 修改标签
const updateTag = (query) => {
  return request({
    url: `/website/tag`,
    method: "put",
    data: query,
  });
};

// 修改分类
const updateCategory = (query) => {
  return request({
    url: `/website/media/category`,
    method: "put",
    data: query,
  });
}

// 获取标签列表
const getTagList = (query) => {
  return request({
    url: `/website/tag/list`,
    method: "get",
    params: query,
  });
};
// 删除标签
const deleteTag = (id) => {
  return request({
    url: `/website/tag/${id}`,
    method: "delete",
  });
}

export {
  getCategoryList,
  addCategory,
  deleteCategory,
  addTag,
  updateTag,
  getTagList,
  deleteTag,
  updateCategory
};
